package com.app.qbake.module.square.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.wind.base.BaseActivity;
import com.wind.base.utils.ActivityUtil;
import com.wind.base.utils.Navigator;
import com.wind.data.square.SquareRequest;
import com.app.qbake.R;
import com.app.qbake.module.mine.activity.BuyedGoodsActivity;
import com.app.qbake.module.square.SquareFragment;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by wind on 2018/11/3.
 */

public class GoodsBuySuccessActivity extends BaseActivity {

    public static void start(Context context,String keywords){
        Navigator.navigate(context,GoodsBuySuccessActivity.class,keywords);
    }

    SquareFragment f;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_goods_buy_success);
        ButterKnife.bind(this);
        String keywords=Navigator.getSerializableExtra(this);
        replaceFragment(f=SquareFragment.getInstance(SquareRequest.TYPE_HOT,keywords));

    }

    @Override
    public void onResume() {
        super.onResume();
        f.disableRecyclerView();
    }

    @Override
    protected void setTitle() {
        mTitleBar.setTitle("支付成功");
    }

    @OnClick({R.id.tv_continue,R.id.tv_look_order})
    public void onViewClick(View v){
        switch (v.getId()){
            case R.id.tv_continue:
                ActivityUtil.finish(getActivity());
                break;
            case R.id.tv_look_order:
                BuyedGoodsActivity.start(getActivity());
                break;

        }
    }
}
